/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.pbv.azsg.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.pbv.azsg.domain.FuelEntity;
import com.pbv.azsg.dao.IFuelDAO;


/**
 *
 * @author b.prikhodko
 */
@Service
public class FuelServiceImpl implements IFuelService {
    
    @Autowired
    private IFuelDAO fuelDAO;
    
    @Transactional
    public List<FuelEntity> getFuels(){
        return fuelDAO.getFuels();       
    }
    
    @Transactional
    public FuelEntity getFuel( Long id ){
        return fuelDAO.getFuels().get( 
                    fuelDAO.getFuels().indexOf( new FuelEntity(id) )
               );
    }
    
    
    
}
